package com.changgou.search.listener;



import com.changgou.search.config.RaabitMqConfig;
import com.changgou.search.service.ESMEssageService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsUpListener {

    @Autowired
    private ESMEssageService esmEssageService;

    @RabbitListener(queues = RaabitMqConfig.SEARCH_ADD_QUEUE)
    public void  receiveMessage(String supId){
        System.out.println("接收到的消息为："+ supId);

        //查询skuList，并导入到索引库
        esmEssageService.importDataBySpuId(supId);
    }
}
